package org.example.lotterysystem.controller.result;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public class FindActivityListResult implements Serializable {
    /**
     * 总量
     */
    private Integer total;

    /**
     * 当前列表
     */
    private List<ActivityInfo> records;

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        FindActivityListResult that = (FindActivityListResult) object;
        return Objects.equals(total, that.total) && Objects.equals(records, that.records);
    }

    @Override
    public int hashCode() {
        return Objects.hash(total, records);
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public List<ActivityInfo> getRecords() {
        return records;
    }

    public void setRecords(List<ActivityInfo> records) {
        this.records = records;
    }

    public static class ActivityInfo implements Serializable{
        /**
         * 活动id
         */
        private Long activityId;

        /**
         * 活动名称
         */
        private String activityName;

        /**
         * 活动描述
         */
        private String description;

        /**
         * 活动是否有效
         */
        private Boolean valid;

        public Long getActivityId() {
            return activityId;
        }

        public void setActivityId(Long activityId) {
            this.activityId = activityId;
        }

        public String getActivityName() {
            return activityName;
        }

        public void setActivityName(String activityName) {
            this.activityName = activityName;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public Boolean getValid() {
            return valid;
        }

        public void setValid(Boolean valid) {
            this.valid = valid;
        }

        @Override
        public boolean equals(Object object) {
            if (this == object) return true;
            if (object == null || getClass() != object.getClass()) return false;
            ActivityInfo that = (ActivityInfo) object;
            return Objects.equals(activityId, that.activityId) && Objects.equals(activityName, that.activityName) && Objects.equals(description, that.description) && Objects.equals(valid, that.valid);
        }

        @Override
        public int hashCode() {
            return Objects.hash(activityId, activityName, description, valid);
        }
    }
}
